<script setup lang="ts">
import { ref } from 'vue'
type Todo = {
  id: string
  name: string
  price: number
}

// 1. ref函数加类型
const todoList = ref<Todo[]>([
  { id: '1001', name: '女士卫衣', price: 280 },
  { id: '1002', name: '女士鞋子', price: 180 },
])
</script>

<template>
  <div>
    <ul>
      <li v-for="item in todoList" :key="item.id">
        序号: {{ item.id }}, 名称: {{ item.name }}, 衣服价格:
        {{ item.price }}
      </li>
    </ul>
  </div>
</template>

<style scoped></style>
